package factory.headfirst.simplefactory;

import factory.headfirst.CheesePizza;
import factory.headfirst.ClamPizza;
import factory.headfirst.PepperoniPizza;
import factory.headfirst.Pizza;
import factory.headfirst.PizzaFactory;
import factory.headfirst.VeggiePizza;

public class SimplePizzaFactory implements PizzaFactory {
	public Pizza createPizza(String type) {
		Pizza pizza = null;
		
		if (type.equals("cheese"))
			pizza = new CheesePizza();
		if (type.equals("clam"))
			pizza = new ClamPizza();
		if (type.equals("veggie"))
			pizza = new VeggiePizza();
		if (type.equals("pepperoni"))
			pizza = new PepperoniPizza();

		return pizza;
	}
}
